package com.cgc.venus.server.app.bean;
import java.util.*;

/**
 * Created by 业哥 on 2018/3/29.
 * 服务(lb) bean
 */
public class ServiceBean {
    private String uid;
    private String name;
    private String namespace;
    private String creationTimestamp;
    private String sessionAffinity;        //服务负载策略  None/ClientIP --> 轮询/客户端请求转发都同一个后端服务(pod)
    private String type;                     //服务类型      ClusterIP/NodePort/LoadBalancer
                                               //ClusterIP:    虚拟的服务ip地址,用于k8s集群内部的Pod访问,在Node上kube-proxy通过设置的iptables规则进行转发
                                               //NodePort:     使用宿主机的端口,使能够访问各Node的外部客户端通过Node的IP地址和端口号就能访问服务
                                               //LoadBalancer: 使用外接负载均衡器完成到服务的负载分发,需要在spec.status.loadBalancer字段指定外部负载均衡器的IP地址,并同时定义nodePort和clusterIP用于公有云环境
    private String clusterIP;               //服务ip

    private Map<String,String> labels;      //服务标签
    private Map<String,String> annotations;//服务注解
    private Map<String,String> selectors;  //后端服务选择器
    private Object status;                  //当type为LoadBalancer 时  设置外部负载均衡器的地址
    private List<ServicePortBean> servicePorts;     //端口列表

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public String getCreationTimestamp() {
        return creationTimestamp;
    }

    public void setCreationTimestamp(String creationTimestamp) {
        this.creationTimestamp = creationTimestamp;
    }

    public String getSessionAffinity() {
        return sessionAffinity;
    }

    public void setSessionAffinity(String sessionAffinity) {
        this.sessionAffinity = sessionAffinity;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getClusterIP() {
        return clusterIP;
    }

    public void setClusterIP(String clusterIP) {
        this.clusterIP = clusterIP;
    }

    public Map<String, String> getLabels() {
        return labels;
    }

    public void setLabels(Map<String, String> labels) {
        this.labels = labels;
    }

    public Map<String, String> getAnnotations() {
        return annotations;
    }

    public void setAnnotations(Map<String, String> annotations) {
        this.annotations = annotations;
    }

    public Map<String, String> getSelectors() {
        return selectors;
    }

    public void setSelectors(Map<String, String> selectors) {
        this.selectors = selectors;
    }

    public Object getStatus() {
        return status;
    }

    public void setStatus(Object status) {
        this.status = status;
    }

    public List<ServicePortBean> getServicePorts() {
        return servicePorts;
    }

    public void setServicePorts(List<ServicePortBean> servicePorts) {
        this.servicePorts = servicePorts;
    }
}
